<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box {
            width: 100px;
            height: 100px;
            background-color: aqua;
        }
    </style>
    </style>
</head>

<body>
    <!-- 点击按钮，  如果div是显示状态，就把div隐藏，否则把div显示出来。 -->
    <div id="app">
        <button @click="show">点击</button>
        <div id="box" v-if="display"></div>

    </div>
</body>
<script src="/vue.js"></script>
<script>
    const { createApp, ref } = Vue;
    createApp({
        setup() {
            let display = ref(false)

            function show() {
                display.value = !display.value
            }
            return {
                show,
                display

            }
        }
    }).mount("#app")
</script>

</html>